<?php
// +-------------------------------------------------------------------
// |
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Service\Api\V1;

use Think\Exception;

class ArchiveAdd
{
    public $login = true; //是否需要登录才能访问该接口
    public $title = "档案添加";
    public $group = '档案管理';
    public $desc = "";

    public $input = [
        'name' => 'required;label=姓名',
        'relation' => 'required;enum=1,2,3,4,5,6,7;label=关系;comment={"1":"自己","2":"父母","3":"孩子","4":"爱人","5":"朋友","6":"同事","7":"其他"}',
        'sex' => 'required;enum=1,2;label=性别;comment=1男2女',
        'birthday' => 'required;;label=生日;格式：1990-08-07',
    ];

    public $output = [
        'id' => 'label=id;',
    ];


    public function run($param, $uid, $login_info)
    {
        $ret = OE('Archives')->archiveAdd($uid, $param);
        return ['id' => $ret];
    }

}